home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1985 November
/
Ahoy_Magazine_85-11_1985_Double_L.d64
/
rhythm. bits
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
4KB
|
175 lines
40 poke 53280,1:poke53281,3
50 poke 650,255
100 gosub 2000
200 print"[147]"
210 print" rhythmic bits"
220 print" by david barron"
230 print"(f1) - define sounds"
240 print"(f3) - enter rhythmic pattern"
250 print"(f5) - change filter"
255 print"(f6) - set speed"
260 print"(f7) - play pattern"
270 print" - enter your selection -"
280 get t$:if t$="" then 280
290 if t$="[133]" then 1000
295 if t$="[134]" then 5500
300 if t$="[135]" then 350
305 if t$="[139]" then 500
310 if t$="[136]" then 6000
320 goto 280
350 print "[147] filter change"
352 print"(f1) - increase"
353 print"(f3) - decrease"
354 print"(f7) - quit"
360 print"low: :high"
380 print""
385 rem
390 print tab(5+fi/10);" [146] [145]"
400 get t$:if t$="" then 400
410 if t$="[133]" then fi=fi+1:if fi>255 then fi=255
420 if t$="[134]" then fi=fi-1:if fi<0 then fi=0
425 if t$="[136]" then 440
430 goto 385
440 poke sid+22,fi
450 goto 200
500 print "[147] speed change"
552 print"(f1) - decrease"
553 print"(f3) - increase"
554 print"(f7) - quit"
560 print"fast: :slow"
580 print""
585 rem
590 print tab(5+sp/10);" [146] [145]"
600 get t$:if t$="" then 600
610 if t$="[133]" then sp=sp+1:if sp>254 then sp=254
620 if t$="[134]" then sp=sp-1:if sp<0 then sp=0
625 if t$="[136]" then 640
630 goto 585
640 poke 49164,sp+1
650 goto 200
1000 print"[147]":poke 650,255:if v>7 then v=0
1020 print""
1030 print"frequency:"
1040 print "decay :"
1050 print"wave type:"
1051 print "use (f1) for frequency increase"
1052 print "use (f2) for frequency decrease"
1053 print "use (f3) for attack increase"
1054 print "use (f4) for attack decrease"
1055 print "use (f5) to change waveform"
1056 print"use (f7) to change sound number"
1057 print"use (spacebar) to test sound"
1058 print"use (x) to exit"
1059 print" sound definition for voice #";v
1060 print"";
1062 base=12*4096+256+v*4
1063 f=peek(base)+peek(base+1)*256
1064 d=peek(base+2):gosub 3000
1066 if d>15 then d=15
1067 if s>2 then s=2
1070 for x=1 to (f/65535)*28
1080 print " ";:next x:print"[146] ";
1090 print"":print"";
1100 for x=1 to d*1.7
1110 print " ";:next x:print"[146] ";
1120 print"":print"";
1130 if s=0 then print"triangle":s1=16
1140 if s=1 then print"sawtooth":s1=32
1150 if s=2 then print"noise ":s1=128
1160 get i$:if i$="" then 1160
1170 if i$="[133]"then f=f+(200^(1.25+f/650000)):if f>65535 then f=65535
1180 if i$="[137]"then f=f-(200^(1.25+f/650000)):if f<0 then f=0
1190 if i$="[134]"then d=d+1:if d>15then d=d-1
1200 if i$="[138]"then d=d-1:if d<0 then d=d+1
1210 if i$="[135]" then gosub 2200
1220 if i$="[136]"then v=v+1:if v>7 then v=0
1225 if i$="[136]"then goto 1000
1230 if i$=" " then poke sid+4,s1:pokesid+4,s1+1
1235 if i$="x" then 200
1240 poke sid,f-int(f/256)*256
1250 poke sid+1,int(f/256)
1260 poke sid+6,d+240
1270 poke sid+4,s1
1280 poke base,f-int(f/256)*256
1290 poke base+1,int(f/256)
1300 poke base+2,d:poke base+3,s1
1500 goto 1059
2000 rem initialize sid chip
2005 sid=54272:fi=128:sp=128
2010 for x=0 to 28
2020 poke sid+x,0:next x
2030 poke sid+21,7:poke sid+23,7:poke sid+22,fi
2040 poke sid+24,31
2050 return
2200 s=s+1:if s>2 then s=0
2205 if s=0 then s1=16
2210 if s=1 then s1=32
2220 if s=2 then s1=128
2230 return
3000 s1=peek(base+3)
3010 if s1=16 then s=0:return
3020 if s1=32 then s=1:return
3030 if s1=128 then s=2:return
3040 s1=16:s=0
3050 return
5000 data 1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1
5010 for x=49152+512 to 49152+512+16
5020 read a:poke x,a:next
5500 print "[147] pattern entry"
5510 print" 11111111112222222222333"
5520 print"[145] 12345678901234567890123456789012"
5525 print"[145][145]"
5530 for x=0 to 7
5550 print "voice";x;"[157]:"
5560 next x
5570 print "[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][145]"
5580 gosub 5850
5585 print"cursor keys move cursor"
5586 print"use (f7) to exit"
5587 print"spacebar toggles marker"
5588 print"use (f3) to clear pattern"
5600 v=0:x=0
5610 loc=40*7+v*40+8+x
5620 poke 1024+loc,peek(1024+loc)or128:poke55296+loc,14
5630 get a$:if a$="" then 5630
5640 if a$=" " then if peek(1024+loc)=86+128then poke 1024+loc,160:goto 5650
5645 if a$=" " then if peek(1024+loc)=160then poke 1024+loc,86+128
5650 if a$="" then x=x+1
5660 if a$="[157]" then x=x-1
5670 if a$="" then v=v+1
5675 if a$="[134]" then for x=49152+512 to 49152+512+32:poke x,0:next x:goto 5500
5680 if a$="[145]" then v=v-1
5685 if a$="[136]" then goto 5750
5690 poke 1024+loc,peek(1024+loc)and127
5700 if x<0 then x=0
5710 if x>31 then x=31
5720 if v<0 then v=0
5730 if v>7 then v=7
5740 goto 5610
5750 print"working.";
5752 for x=0 to 30
5755 s=0
5757 print".";
5760 for v=0 to 7
5770 loc=40*7+v*40+8+x
5780 if (peek(1024+loc)and127)=86 then s=s+2^v
5790 next v
5800 poke 49152+512+x,s
5810 next x
5815 gosub 8000
5820 goto 200
5850 for x=0 to 31
5860 for v=0 to 7
5862 if peek(49152+512+x)=0 then 5895
5865 if (peek(49152+512+x)and(2^v))=0 then 5890
5870 loc=40*7+v*40+8+x
5880 poke 1024+loc,86:poke 55296+loc,14
5890 next v
5895 next x:return
6000 sys 49312:if peek(197)=64 then 6000
6010 goto 200
8000 s=0:for v=0 to 7
8010 if (peek(40*7+v*40+39+1024)and127)=86 then s=s+2^v
8020 next v:poke 49152+512+31,s:return
9999 goto 9999